/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import java.awt.Component;
import java.awt.GraphicsConfiguration;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JPanel;
import schema.Simbolo;

/**
 *
 * @author Antonio
 */
public class SolverFutoshiki extends javax.swing.JFrame {

    private SolverPresentazione sPresentazione;
    private SolverSchema sSchema;
    private SolverSoluzione sSoluzione;

    /**
     * Creates new form SolverFutoshiki
     */
    public SolverFutoshiki() {
        //initComponents();

        setDefaultCloseOperation(EXIT_ON_CLOSE);

        // pannelli
        sPresentazione = new SolverPresentazione(this);

        add(sPresentazione);
    }

    public void addSchema() {

        add(new SolverSchema(this));
    }// addSchema

    public void addSoluzione(List<int[][]> sol, List<Simbolo> simbol) {

        add(new SolverSoluzione(this, sol, simbol));
    }// addSoluzione

    @Override
    public void remove(Component comp) {

        super.remove(comp);
        pack();
    }

    @Override
    public Component add(Component comp) {

        Component c = super.add(comp);
        pack();

        return c;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Solver Futoshiki");
        setMaximumSize(new java.awt.Dimension(800, 500));
        setMinimumSize(new java.awt.Dimension(500, 350));
        setResizable(false);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 418, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 366, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
